<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
</html>
<script type="text/javascript">
	const obj1 = {
		username: '洪源',
		age: 18,
		// 引用类型
		o: {x:100}
	}
	
	// 使obj2拥有所有obj1的属性，属于浅拷贝
	const obj2 ={
		...obj1,
		addr:'深圳市宝安区',
		age: 28
	}
	console.log(obj2);
	obj2.username = 'zhangsan';
	console.log(obj1.username);
	
	obj2.o.x = 200;
	console.log(obj1.o.x);
</script>
